home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------
- //
- // ADOBE SYSTEMS INCORPORATED
- // Copyright 2000-2002 Adobe Systems Incorporated
- // All Rights Reserved
- //
- // NOTICE: Adobe permits you to use, modify, and distribute
- // this file in accordance with the terms of the Adobe license
- // agreement accompanying it. If you have received this file
- // from a source other than Adobe, then your use, modification,
- // or distribution of it requires the prior written permission
- // of Adobe.
- //
- //------------------------------------------------------------------------------
-
-
- //----------------------------------------------------
- // inspect functions:
- //
- // Description:
- // Called by inspectBox() for each custom box.
- // Sets up inspector control values based on
- // custom box settings.
-
- function inspectA(box)
- {
- if (!document) {
- // need document for getWMLVersion()
- // an inspector should always have a
- // document anyway.
- return;
- }
- var version = getWMLVersion(document);
-
- if (version == "1.1") {
- box.classid = "idA11";
- }
- else {
- box.classid = "idA";
- }
-
- var insp = box.inspector;
- insp.ctlAID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlAClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlATitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlAXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- if (version == "1.1") {
- insp.ctlA11href.setLink (box.ctlAhref);
- }
- else {
- insp.ctlAhref.setLink (box.ctlAhref);
- }
-
- if (version != "1.1") {
- // default to 1.3 behavior
- insp.ctlAAccess.value = (box.element["accesskey"]) ? box.element["accesskey"] : "";
- }
- }
-
- function inspectAnchor(box)
- {
- if (!document) {
- // need document for getWMLVersion()
- // an inspector should always have a
- // document anyway.
- return;
- }
- var version = getWMLVersion(document);
-
- if (version == "1.1") {
- box.classid = "idAnchor11";
- }
- else {
- box.classid = "idAnchor";
- }
-
- var insp = box.inspector;
- insp.ctlAnchorID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlAnchorClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlAnchorTitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlAnchorXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
-
- if (version != "1.1") {
- // default to 1.3 behavior
- insp.ctlAnchorAccess.value = (box.element["accesskey"]) ? box.element["accesskey"] : "";
- }
- }
-
- function inspectCard (box)
- {
- var insp = box.inspector;
- insp.controls["title"].value = (box.element.title) ? box.element.title : "";
- insp.controls["onenterforward"].setLink (box.onenterforward);
- insp.controls["onenterbackward"].setLink (box.onenterbackward);
- insp.controls["ontimer"].setLink (box.ontimer);
-
- // false is the default value
- insp.controls["newcontext"].value = (box.element.newcontext) ? box.element.newcontext : "false";
-
- // true is the default value
- insp.controls["ordered"].value = (box.element.ordered) ? box.element.ordered : "true";
-
- insp.controls["id"].value = (box.element.id) ? box.element.id : "";
- insp.controls["classCard"].value = (box.element ["class"]) ? box.element["class"] : "";
- insp.cXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- }
-
- function inspectDo (box)
- {
- var insp = box.inspector;
- insp.ctlDoID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlDoClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlDoLabel.value = (box.element["label"]) ? box.element["label"] : "";
- insp.ctlDoName.value = (box.element["name"]) ? box.element["name"] : "";
- // false is the default value
- insp.ctlDoOptional.value = (box.element["optional"]) ? box.element["optional"] : "false";
- insp.ctlDoXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
-
- // set insp.ctlDoType
- if (box.element["type"]) {
- switch (box.element["type"]) {
- case "accept":
- case "prev":
- case "help":
- case "reset":
- case "options":
- case "delete":
- insp.ctlDoType.value = box.element["type"];
- insp.ctlDoTypeEdit.enabled = false;
- insp.ctlDoTypeEdit.posx = 9000;
- break;
- default:
- insp.ctlDoType.value = "unknown";
- insp.ctlDoTypeEdit.enabled = true;
- insp.ctlDoTypeEdit.value = box.element["type"];
- insp.ctlDoTypeEdit.posx = 162;
- break;
- }
- }
- else { // type attr not defined
- insp.ctlDoType.value = "unknown";
- insp.ctlDoTypeEdit.enabled = true;
- insp.ctlDoTypeEdit.value = "";
- insp.ctlDoTypeEdit.posx = 162;
- }
- }
-
- function inspectFieldset(box)
- {
- var insp = box.inspector;
- insp.ctlFieldSetID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlFieldSetClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlFieldSetTitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlFieldSetXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- }
-
- function inspectGo(box)
- {
- if (!document) {
- // need document for getWMLVersion()
- // an inspector should always have a
- // document anyway.
- return;
- }
- var version = getWMLVersion(document);
-
- if (version == "1.1") {
- box.classid = "idGo11";
- }
- else {
- box.classid = "idGo";
- }
-
- var insp = box.inspector;
- if (version == "1.1") {
- insp.ctlGo11Href.enabled = true;
- insp.ctlGo11Href.setLink (box.ctlGoHref);
- }
- else {
- insp.ctlGoHref.enabled = true;
- insp.ctlGoHref.setLink (box.ctlGoHref);
- }
- insp.ctlGoID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlGoClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlGoMethod.value = (box.element["method"]) ? box.element["method"] : "get";
- insp.ctlGoAccChar.value = (box.element["accept-charset"]) ? box.element["accept-charset"] : "";
- insp.ctlGoSendref.value = (box.element["sendreferer"]) ? box.element["sendreferer"] : "false";
-
- if (version != "1.1") {
- // default to 1.3 attributes
- insp.ctlGoEnctype.value = (box.element["enctype"]) ? box.element["enctype"] : "";
- insp.ctlGoCache.value = (box.element["cache-control"]) ? box.element["cache-control"] : " ";
- }
- }
-
-
- function inspectImg(box)
- {
- var insp = box.inspector;
- insp.ctlImgid.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlImgclass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlImgalt.value = (box.element["alt"]) ? box.element["alt"] : "";
- insp.ctlImglocalsrc.value = (box.element["localsrc"]) ? box.element["localsrc"] : "";
- insp.ctlImgvspace.value = (box.element["vspace"]) ? box.element["vspace"] : "0";
- insp.ctlImghspace.value = (box.element["hspace"]) ? box.element["hspace"] : "0";
- insp.ctlImgalign.value = (box.element["align"]) ? box.element["align"] : "bottom";
- insp.ctlImgheight.value = (box.element["height"]) ? box.element["height"] : "";
- insp.ctlImgwidth.value = (box.element["width"]) ? box.element["width"] : "";
- insp.ctlImgXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- insp.ctlImgsrc.setLink (box.ctlImgsrc);
- }
-
- function inspectInput(box)
- {
- if (!document) {
- // need document for getWMLVersion()
- // an inspector should always have a
- // document anyway.
- return;
- }
- var version = getWMLVersion(document);
-
- if (version == "1.1") {
- box.classid = "idInput11";
- }
- else {
- box.classid = "idInput";
- }
-
- var insp = box.inspector;
- insp.ctlInputID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlInputClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlInputName.value = (box.element["name"]) ? box.element["name"] : "";
- insp.ctlInputType.value = (box.element["type"]) ? box.element["type"] : "text";
- insp.ctlInputSize.value = (box.element["size"]) ? box.element["size"] : "";
- insp.ctlInputMaxLength.value = (box.element["maxlength"]) ? box.element["maxlength"] : "";
- insp.ctlInputTabIndex.value = (box.element["tabindex"]) ? box.element["tabindex"] : "";
- insp.ctlInputXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- insp.ctlInputValue.value = (box.element["value"]) ? box.element["value"] : "";
- insp.ctlInputFormat.value = (box.element["format"]) ? box.element["format"] : "";
- insp.ctlInputTitle.value = (box.element["title"]) ? box.element["title"] : "";
-
- if (version == "1.1")
- insp.ctlInputEmptyOK.value = (box.element["emptyok"]) ? box.element["emptyok"] : "false";
- else {
- // default to 1.3
- insp.ctlInputEmptyOK.value = (box.element["emptyok"]) ? box.element["emptyok"] : " ";
- insp.ctlInputAccess.value = (box.element["accesskey"]) ? box.element["accesskey"] : "";
- }
- }
-
- function inspectNoop(box)
- {
- var insp = box.inspector;
- insp.ctlNoopID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlNoopClass.value = (box.element["class"]) ? box.element["class"] : "";
- }
-
- function inspectOnevent(box)
- {
- var insp = box.inspector;
- insp.ctlOnEventID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlOnEventClass.value = (box.element["class"]) ? box.element["class"] : "";
-
- // set insp.ctlOnEventType
- if (box.element["type"]) {
- switch (box.element["type"]) {
- case "ontimer":
- case "onenterforward":
- case "onenterbackward":
- case "onpick":
- insp.ctlOnEventType.value = box.element["type"];
- insp.ctlOnEventTypeEdit.enabled = false;
- insp.ctlOnEventTypeEdit.posx = 9000;
- break;
- default:
- insp.ctlOnEventType.value = "unknown";
- insp.ctlOnEventTypeEdit.enabled = true;
- insp.ctlOnEventTypeEdit.value = box.element["type"];
- insp.ctlOnEventTypeEdit.posx = 170;
- break;
- }
- }
- else { // type attr not defined
- insp.ctlOnEventType.value = "unknown";
- insp.ctlOnEventTypeEdit.enabled = true;
- insp.ctlOnEventTypeEdit.value = "";
- insp.ctlOnEventTypeEdit.posx = 170;
- }
- }
-
- function inspectOption(box)
- {
- var insp = box.inspector;
- insp.ctlOptionID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlOptionClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlOptionTitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlOptionValue.value = (box.element["value"]) ? box.element["value"] : "";
- insp.ctlOptionOnPick.value = (box.element["onpick"]) ? box.element["onpick"] : "";
- insp.ctlOptionXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- }
-
- function inspectOptiongroup(box)
- {
- var insp = box.inspector;
- insp.ctlOptGroupID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlOptGroupClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlOptGroupTitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlOptGroupXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- }
-
- function inspectPostfield(box)
- {
- var insp = box.inspector;
- insp.ctlPostFieldID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlPostFieldClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlPostFieldName.value = (box.element["name"]) ? box.element["name"] : "";
- insp.ctlPostFieldValue.value = (box.element["value"]) ? box.element["value"] : "";
- }
-
- function inspectPre(box)
- {
- var insp = box.inspector;
- insp.ctlPreID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlPreClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlPreXmlSpace.value = (box.element["xml:space"]) ? box.element["xml:space"] : "";
-
- }
-
- function inspectPrev(box)
- {
- var insp = box.inspector;
- insp.ctlPrevID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlPrevclass.value = (box.element["class"]) ? box.element["class"] : "";
- }
-
- function inspectRefresh(box)
- {
- var insp = box.inspector;
- insp.ctlRefreshID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlRefreshclass.value = (box.element["class"]) ? box.element["class"] : "";
- }
-
- function inspectSelect(box)
- {
- var insp = box.inspector;
- insp.ctlSelectID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlSelectClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlSelectName.value = (box.element["name"]) ? box.element["name"] : "";
- insp.ctlSelectMultiple.value = (box.element["multiple"]) ? box.element["multiple"] : "false";
- insp.ctlSelectTabIndex.value = (box.element["tabindex"]) ? box.element["tabindex"] : "";
- insp.ctlSelectTitle.value = (box.element["title"]) ? box.element["title"] : "";
- insp.ctlSelectValue.value = (box.element["value"]) ? box.element["value"] : "";
- insp.ctlSelectiname.value = (box.element["iname"]) ? box.element["iname"] : "";
- insp.ctlSelectXMLLang.value = (box.element["xml:lang"]) ? box.element["xml:lang"] : "";
- insp.ctlSelectivalue.value = (box.element["ivalue"]) ? box.element["ivalue"] : "";
- }
-
- function inspectSetvar(box)
- {
- var insp = box.inspector;
- insp.ctlSetvarID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlSetvarClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlSetvarName.value = (box.element["name"]) ? box.element["name"] : "";
- insp.ctlSetvarValue.value = (box.element["value"]) ? box.element["value"] : "";
- }
-
- function inspectTemplate(box)
- {
- var insp = box.inspector;
- insp.ctlTemplateOnEnterForward.enabled = true;
- insp.ctlTemplateOnEnterBackward.enabled = true;
- insp.ctlTemplateOnTimer.enabled = true;
- insp.ctlTemplateID.value = (box.element.id) ? box.element.id : "";
- insp.ctlTemplateClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlTemplateOnEnterForward.setLink (box.ctlTemplateOnEnterForward);
- insp.ctlTemplateOnEnterBackward.setLink (box.ctlTemplateOnEnterBackward);
- insp.ctlTemplateOnTimer.setLink (box.ctlTemplateOnTimer);
- }
-
- function inspectTimer(box)
- {
- var insp = box.inspector;
- insp.ctlTimerID.value = (box.element["id"]) ? box.element["id"] : "";
- insp.ctlTimerClass.value = (box.element["class"]) ? box.element["class"] : "";
- insp.ctlTimerName.value = (box.element["name"]) ? box.element["name"] : "";
- insp.ctlTimerValue.value = (box.element["value"]) ? box.element["value"] : "";
- }